//
//  WBDemoViewController.swift
//  SinaWeibo
//
//  Created by Jiang on 2016/11/23.
//  Copyright © 2016年 Jiang. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }
    // MARK: - 监听方法
    // 继续 push  一个新的控制器
    @objc func showNext(){
        let vc = WBDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension WBDemoViewController{
    //重写父类方法
    override func setupUI(){
        super.setupUI()
        
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self , action: #selector(showNext))
    }
}
